package com.itheima.sh.controller;

import com.itheima.sh.pojo.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Version: V1.0
 */
@RestController
@RequestMapping("user")
public class IndexController {

    @Value("${msg1}")
    private String msg1;

    @Value("${msg2}")
    private String msg2;

    @Autowired
    Environment environment;

    @Autowired
    Person person;

    @GetMapping("index")
    public String index(){
        System.out.println(msg1);
        System.out.println("---------");
        System.out.println(msg2);
        System.out.println("---------");
        System.out.println( environment.getProperty("server.port")  );
        System.out.println("---------");
        System.out.println(person);

        return "SpringBoot Index..";
    }

}
